import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class CustomInterceptor extends AbstractInterceptor {
    private static final long serialVersionUID = -8870690357327413648L;

    @Override
    public String intercept(ActionInvocation actionInvocation) throws Exception {
        CustomAction action = (CustomAction) actionInvocation.getAction();
        if (action instanceof CustomAction) {
            action.setState(true);
        }
        return actionInvocation.invoke();
    }
}
